Link Creation problem

This has got to end up being a schoolboy error; all I'm trying to do is copy the links from one object to another, but I am getting complaints about the arguments I am using (Object) with the '<-' link creation operator (<-)......

 

   Object currentObject = current Object
   Object newObject = next (currentObject)

   Link inLink  

   for inLink in (currentObject) <- "*" do 
   {
      Object sourceObject = source(inLink)
 
       Link newLink
       newLink = newObject <- sourceObject
    }  
 

I'm using DOORS 9.5.2.0.


Arlo - Mon Jun 30 11:41:39 EDT 2014

Re: Link Creation problem
Gedinfo - Mon Jun 30 12:31:40 EDT 2014

I ran this on a module in 9.4.0.0, and did not experience any errors.

 

However, the script did not give me any indication that it actually performed anything.

 

 

Re: Link Creation problem
llandale - Mon Jun 30 15:44:33 EDT 2014

You need to open the source module to make sure your sourceObject handle is valid.  That other module needs to be open Edit (or shared with a section lock).

You need to specify the link module, unless you are confident your default linksetpairings are good.  You can get the current link's LinkModule with

  • Module mLinkMod = module(inLink)

-Louie

My intuition tells me the "source ->LinkMod->target" construct is superior to the "target<-LinkMod<-source" construct.  If you get stuck give it a try.

Re: Link Creation problem
Arlo - Tue Jul 01 04:00:37 EDT 2014

In my defence I did start off saying that it was probably a schoolboy error...

I stripped the script write down to the bare minimum so that I could post you the whole script that showed the error and of course it worked fine. It turned out to be a missing curly bracket!!!! SORRY!